<template>
	<view>
		<cu-custom bgColor="bg-white" isBack="true">
			<block slot="content">合作反馈</block>
		</cu-custom>
		<loading-view v-if="showLoading"></loading-view>
		<view class="layout" v-show="!showLoading">
			
			
			<view class="group1">
				<view class="top">
					<input type="text" placeholder="反馈标题" />
				</view>
				<view class="bottom">
					<textarea v-model="description" placeholder-style="color:#cccccc" placeholder="请输入"></textarea>
					<!-- <input type="text" placeholder="请输入反馈内容" @change="modifyDescription" /> -->
				</view>
			</view>
			<button class="btn" @click="submitDescription">提交</button>
		</view>
	</view>
</template>
<script>
import request from '@/common/request.js';
import api from '../../common/apiService';


const { feedback } = api;

export default {
  data() {
    return {
      description: ''
    };
  },
  methods: {
    // modifyDescription(e) {
    //   this.description = e.target.value;
    // },
    submitDescription() {
      const uid = uni.getStorageSync('uid');
      feedback(uid, this.description)
        .then(data => {
          uni.showToast({
            title: '提交成功',
            icon: 'none'
          });
        }).then(()=>{
			setTimeout(()=>{
				uni.redirectTo({
					url:'/pages/mine/mine'
				})
			},1500)
		})
        .catch(e => {
          uni.showToast({
            title: e.msg || '请求失败，请稍后再试',
            icon: 'none'
          });
        });
    }
  }
};

</script>

<style lang="scss" scoped>
	.layout {
		background: #f5f5f5;

		.group1 {
			width: 750rpx;
			height: 550rpx;
			background: #ffffff;
			margin: 24rpx 0 0 0;

			.top {
				margin-top: 40rpx;
				width: 680rpx;
				height: 100rpx;
				// border: 1px solid red;
				margin: 0 35rpx 0 35rpx;

				input {
					width: 680rpx;
					height: 100rpx;
					line-height: 100rpx;
					background: #f5f5f5;
					padding-left: 21rpx;
					box-sizing: border-box;
				}
			}

			.bottom {
				width: 750rpx;
				height: 647rpx;
				background-color: #FFFFFF;
				padding: 47rpx 35rpx;
			}
			.bottom textarea{
				width: 680rpx;
				height: 487rpx;
				background: #f5f5f5;
				border: 2rpx solid #E5E5E5;
				padding: 30rpx 20rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				// font-weight: 800;
				color: #000000;
			}
		}

		.btn {
			width: 680rpx;

			color: #ffffff;
			margin-top: 20rpx;
			background-color: #18288f;
			border-radius: 45rpx;
			margin-top: 90rpx;
		}

	}
</style>